package com.fanghuaiming.tsec.pay.service.impl;

import com.fanghuaiming.tsec.pay.dao.mapper.TsecPayMapper;
import com.fanghuaiming.tsec.pay.dao.model.TsecPay;
import com.fanghuaiming.tsec.pay.service.PayService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/****
 * @description: 支付服务接口实现类
 * @version:1.0.0
 * @author fanghuaiming
 * @data Created in 2020/11/27 下午1:59
 *
 */
@Service
@Slf4j
public class PayServiceImpl implements PayService {

    /**
     * 账户mapper
     */
    @Autowired
    private TsecPayMapper tsecPayMapper;


    /**
     * @Description: 更新支付状态
     *
     * @param:
     * @return:
     * @auther: fanghuaiming
     * @date: 2020/12/1 下午2:43
     * @version:1.0.0
     */
    @SuppressWarnings("all")
    @Transactional
    @Override
    public void updatePayStatus(TsecPay tsecPay) {
        log.info("==========支付Service开始创建订单==========");
        tsecPayMapper.updatePayStatus(tsecPay);
        if(tsecPay.getPayStatus() == 2){
            int i = 2/0;
        }
        log.info("==========支付Service开始创建订单==========");
    }
}
